#set(seoTitle="修改密码")
#@layout()
#define main()
<!-- 个人空间左侧菜单栏 -->
#include("/_view/my/common/_my_menu_bar.html")

<!-- 内容容器 -->
<div class="jf-panel-box jf-pull-right">

	<!-- 项目 -->
	<div class="jf-my-panel">
		<div class="jf-breadcrumb-box">
			<ol class="jf-breadcrumb">
				<li><a href="/my">我的空间</a></li>
				<li class="active">修改密码</li>
			</ol>
		</div>

		<div class="jf-my-info">
			<div class="password-update-box">
				<!--<h2>修改密码</h2>-->
				<form id="password_update_form" action="/my/setting/updatePassword" method="post">
					<table class="update-password-table">
						<tr>
							<th>原密码</th>
							<td><input type="password" name="oldPassword" /></td>
						</tr>
						<tr>
							<th>新密码</th>
							<td><input type="password" name="newPassword" /></td>
						</tr>
						<tr>
							<th>&nbsp;</th>
							<td>
								<input id="password_update_btn" type="submit" value="提交"/>
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>

	</div>

</div>
#end

#define js()
	<script type="text/javascript" src="/assets/jquery_form/jquery.form.min.js"></script>
	<script type="text/javascript" src="/assets/layer/layer/layer.js"></script>

	<script type="text/javascript">
		// 选中左侧菜单项
		$(document).ready(function() {
			setCurrentMyMenu();
		});

		// 使用 ajax form 提交图像裁剪坐标
		$(document).ready(function() {
			$("#password_update_form").ajaxForm({
				dataType: "json"
				, beforeSubmit: function(formData, jqForm, options) {
				}
				, success: function(ret) {
					if (ret.state == "ok") {
						showOkMsg(ret.msg);
					} else {
						showErrorMsg(ret.msg);
					}
				}
				, error: function(ret) {
					alert(ret.msg);
				}
			});
		});

		function showOkMsg(msg) {
			layer.msg(msg, {
						shift: 0
						, shade: 0.4
						, time: 0
						, offset: "140px"
						, closeBtn: 1
						, shadeClose: false
						,maxWidth: "1000"
					}, function () {
						location.href = "/my";
					}
			);
		}

		function showErrorMsg(msg) {
			layer.msg(msg, {
						shift: 6
						, shade: 0.4
						, time: 0
						, offset: "140px"
						, closeBtn: 1
						, shadeClose: true
						,maxWidth: "1000"
					}, function () {}
			);
		}
	</script>
#end